<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/include.jsp" %>
<%@ include file="/WEB-INF/jsp/header.jsp" %>

<title>История заказов </title>
<a href="person?id=${person.id}">
	<div class="mybutton">
		К клиенту
	</div>
</a>
<br><br><br>
<table style="border-collapse : separate">
<tr>
	<th style="background: #fff">ФИО: ${person.first_name} ${person.middle_name} ${person.last_name}</th>
</tr>
</table>
<c:if test="${pts.size() == 0}">
Пользователь еще не оформлял заказы
</c:if>
<c:if test="${pts.size() != 0}">
<table>
<tr>
	<th>Номер рейса</th>
	<th>Пункт отправки</th>
	<th>Пункт прибытия</th>
	<th>Компания</th>
</tr>

<c:forEach items="${pts}" varStatus="i" var="pt">
	<tr>
		<td><a href="trip?id=${pt.trip.id}"> №${pt.trip.number}</a></td>
		<td>${pt.departure_stop.name}</td>
		<td>${pt.arrival_stop.name}</td>
		<td>${pt.trip.company.name}</td>
	</tr>
</c:forEach>
</table>
</c:if>
<%@ include file="/WEB-INF/jsp/footer.jsp" %>